package com.headwind.retry.controller;

import com.headwind.retry.service.RetryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : Headwind
 * @version : 1.0
 * @date : Created in 2020/8/12
 * @description :
 */
@RestController
public class RetryController {
    private final RetryService retryService;

    @Autowired
    public RetryController(RetryService retryService) {
        this.retryService = retryService;
    }

    @GetMapping("/user")
    public String findByUserId(Model model) {
        String result = retryService.findByUserId("A123");
        model.addAttribute("user", result);
        return "Success";
    }
}
